<template>
    <z-paging ref="paging" v-model="shopList" @query="queryList">
        <u-sticky>
            <hedsty :mrbot="'32'" :headCentext="'参与记录'"></hedsty>
            <view class="hedongtab">
                <view class="dange_hedx_box" :class="hdtabId == item.id ? 'dange_hedx_box1' : ''"
                    v-for="(item, index) in hdTabList" :key="index" @click="tabsBtn(item)">
                    {{ item.text }}
                </view>
            </view>
        </u-sticky>
        <view class="dange_box" v-for="(item, index) in shopList" :key="index">
            <view class="top_xiaowenzi_box">{{ item.content }}</view>
            <view class="zhongjian_hezi_box">
                <view class="left_box">
                    <image :src="item.draw_image" mode="widthFix" />
                </view>
                <view class="right_box">
                    <view class="to_box">{{ item.draw_name }}</view>
                    <view class="jiagebox">¥0.00</view>
                </view>
            </view>

            <view class="anniu_box" @click="ljJon(item)">{{ hdtabId == 1 ? '进行中' : '已结束' }}</view>
        </view>
    </z-paging>
</template>
<script>
import hedsty from '../../components/hedsty.vue'
export default {
    components: {
        hedsty
    },
    data() {
        return {
            shopList: [],
            hdTabList: [
                {
                    id: 1,
                    text: '进行中'
                },
                {
                    id: 2,
                    text: '已结束'
                },
            ],
            hdtabId: 1,
        }
    },
    onLoad() {

    },
    onShow() {
        uni.hideLoading()
    },
    methods: {
        tabsBtn(item) {
            this.hdtabId = item.id
            this.$refs.paging.reload()
        },
        ljJon(item) {
            this.$router('/userPage/luckydraw/luckydraw?id=' + item.luck_draw_id)
        },
        queryList(pageNo, pageSize) {
            let data = {
                page: pageNo,
                limit: pageSize,
                is_finish: this.hdtabId
            }
            this.$Request.get(this.$api.user.luckDrawsRecords, data).then(res => {
                if (res.code == 200) {
                    this.$refs.paging.complete(res.data.data.data)
                }
            })

        },
    }
}
</script>
<style lang="scss" scoped>
.hedongtab {
    width: 100%;
    height: 80rpx;
    box-sizing: border-box;
    padding-left: 23rpx;
    display: flex;
    justify-content: flex-start;
    margin-bottom: 30rpx;

    .dange_hedx_box {
        width: 161rpx;
        height: 80rpx;
        background-size: 100% 100%;
        margin-right: 20rpx;
        font-family: text1;
        font-weight: normal;
        font-size: 30rpx;
        color: rgba(255, 255, 255, .4);
        line-height: 80rpx;
        font-style: italic;
        text-align: center;

        &.dange_hedx_box1 {
            font-family: text1;
            font-weight: normal;
            font-size: 30rpx;
            color: #EED52E;
            font-style: italic;
        }
    }
}

.dange_box {
    width: 720rpx;
    height: 274rpx;
    background-image: url('https://morgan.dingxians.cn/upload/20241029/6720a9169e104.png');
    background-size: 100% 100%;
    margin: auto;
    margin-bottom: 10rpx;
    box-sizing: border-box;
    padding-top: 4rpx;
    position: relative;

    .top_xiaowenzi_box {
        width: 100%;
        height: 24rpx;
        font-family: Source Han Sans, Source Han Sans;
        font-weight: 500;
        font-size: 17rpx;
        color: #FFFFFF;
        line-height: 24rpx;
        text-align: center;
        font-style: normal;
        text-transform: none;
        margin-bottom: 26rpx;
    }

    .zhongjian_hezi_box {
        width: 100%;
        height: 158rpx;
        box-sizing: border-box;
        padding: 0 46rpx;
        display: flex;
        justify-content: flex-start;

        .left_box {
            width: 156rpx;
            height: 158rpx;
            background-image: url('https://morgan.dingxians.cn/static/fuyuri/16.png');
            background-size: 100% 100%;
            display: flex;
            justify-content: center;
            align-items: center;
            margin-right: 30rpx;

            image {
                width: 120rpx;
            }
        }

        .right_box {
            width: 400rpx;
            height: 158rpx;
            box-sizing: border-box;
            padding-top: 18rpx;

            .to_box {
                width: 100%;
                height: 44rpx;
                font-family: Source Han Sans, Source Han Sans;
                font-weight: 500;
                font-size: 30rpx;
                color: #FFFFFF;
                line-height: 44rpx;
                text-align: left;
                font-style: normal;
                text-transform: none;
                margin-bottom: 14rpx;
            }

            .jiagebox {
                width: 100%;
                height: 50rpx;
                font-family: Source Han Sans, Source Han Sans;
                font-weight: 500;
                font-size: 34rpx;
                color: #FFFFFF;
                line-height: 50rpx;
                text-align: left;
                font-style: normal;
                text-transform: none;
            }
        }
    }

    .anniu_box {
        position: absolute;
        width: 158rpx;
        height: 56rpx;
        text-align: center;
        border-radius: 0rpx 0rpx 0rpx 0rpx;
        font-family: Source Han Sans, Source Han Sans;
        background-image: url('https://morgan.dingxians.cn/upload/20241028/671f328ab8cb9.png');
        background-size: 100% 100%;
        font-weight: 500;
        font-size: 24rpx;
        color: #FFFFFF;
        line-height: 40rpx;
        text-align: center;
        font-style: normal;
        text-transform: none;
        right: 40rpx;
        bottom: 70rpx;
    }
}
</style>
